#ifndef __PB_PHOTOFRAME_H__
#define __PB_PHOTOFRAME_H__

#include "pb_general.h"

UINT8 photoFrameView(
  UINT16 fileIndex, 
  UINT32 frameResIdx 
  );

UINT8 photoFrameSave( 
  UINT16 fileIndex, 
  UINT32 frameResIdx 
  );

UINT8 decodeImage(
  UINT16 fileIndex,
  UINT32 *decAddr,
  UINT32 endAddr,
  UINT8 decOpt,
  UINT16 *imageWidth,
  UINT16 *imageHeight,
  UINT16 *destWidth,
  UINT16 *destHeight
  );
UINT8 decodeImageData( 
  struct Exif_Decompress_Parameter* imagePara,
  UINT32 *decAddr, 
  UINT32 endAddr, 
  UINT16 *destWidth, 
  UINT16 *destHeight 
  );
UINT8 calImageScalFac4PhotoFrame( 
  UINT32 bufSize, 
  UINT16 srcWidth, 
  UINT16 srcHeight,
  UINT16 *destWidth, 
  UINT16 *destHeight 
  );
UINT32 moveImage2Center( 
  UINT32 startAddr, 
  UINT32 freeEndAddr, 
  UINT16 width, 
  UINT16 height, 
  UINT8 dmyX, 
  UINT8 dmyY 
  );
void fillBufBlack(
  UINT32 dstAddr, 
  UINT16 bufWidth,
  UINT16 bufHeight
  );

void displayImage( 
  UINT32 imageBufAddr, 
  UINT16 imageWidth, 
  UINT16 imageHeight 
  );
void photoFrameCombine( 
  UINT32 imageBufAddr,  
  UINT16 imageWidth, 
  UINT16 imageHeight, 
  UINT32 frameBufAddr, 
  UINT16 frameWidth,
  UINT16 frameHeight
  );
void encodeImage( 
  UINT32 mainImageAddr, 
  UINT16 width, 
  UINT16 height, 
  UINT16 destWidth, 
  UINT16 destHeight 
  );

UINT32 pbEditFileLoad(
  PBFile_t* pFile,
  struct Exif_Decompress_Parameter* mainPara, 
  struct Exif_Decompress_Parameter* thumbPara,
  struct Exif_Decompress_Parameter* qvPara
  );
UINT8 pbEditFileMake(
  UINT32 startAddr, 
  UINT32 size
  );
UINT32 pbEditImgMoveBufEnd(
  UINT32 srcAddr, 
  UINT16 imgW, 
  UINT32 imgH, 
  UINT32 endBufAddr
  );

#endif
